package com.note.chh.notebook.Uitls;

import android.content.Context;
import android.view.View;
import android.widget.Toast;

import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet;

/**
 * Created by caihuahui on 2018/1/10.
 */

public class BottomSheetUtils {
    /**
     * 显示在底部的弹出层(列表式)
     *
     * @param context
     * @return
     */
    public static QMUIBottomSheet.BottomListSheetBuilder showSimpleBottomSheetList(Context context){
        QMUIBottomSheet.BottomListSheetBuilder builder = new QMUIBottomSheet.BottomListSheetBuilder(context);
//                .addItem("Item 1")
//                .addItem("Item 2")
//                .addItem("Item 3")
//                .setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() {
//                    @Override
//                    public void onClick(QMUIBottomSheet dialog, View itemView, int position, String tag) {
//                        dialog.dismiss();
//                        Toast.makeText(getActivity(), "Item " + (position + 1), Toast.LENGTH_SHORT).show();
//
//
//                    }
//                });
//                .build()
//                .show();
        return builder;
    }

    /**
     *显示在底部的弹出层(方格式)
     *
     * @param context
     * @return
     */
    public static QMUIBottomSheet.BottomGridSheetBuilder showSimpleBottomSheetGrid(Context context) {

        QMUIBottomSheet.BottomGridSheetBuilder builder = new QMUIBottomSheet.BottomGridSheetBuilder(context);
//        builder.addItem(R.mipmap.icon_more_operation_share_friend, "分享到微信", TAG_SHARE_WECHAT_FRIEND, QMUIBottomSheet.BottomGridSheetBuilder.FIRST_LINE)
//                .addItem(R.mipmap.icon_more_operation_share_moment, "分享到朋友圈", TAG_SHARE_WECHAT_MOMENT, QMUIBottomSheet.BottomGridSheetBuilder.FIRST_LINE)
//                .addItem(R.mipmap.icon_more_operation_share_weibo, "分享到微博", TAG_SHARE_WEIBO, QMUIBottomSheet.BottomGridSheetBuilder.FIRST_LINE)
//                .addItem(R.mipmap.icon_more_operation_share_chat, "分享到私信", TAG_SHARE_CHAT, QMUIBottomSheet.BottomGridSheetBuilder.FIRST_LINE)
//                .addItem(R.mipmap.icon_more_operation_save, "保存到本地", TAG_SHARE_LOCAL, QMUIBottomSheet.BottomGridSheetBuilder.SECOND_LINE)
//                .setOnSheetItemClickListener(new QMUIBottomSheet.BottomGridSheetBuilder.OnSheetItemClickListener() {
//                    @Override
//                    public void onClick(QMUIBottomSheet dialog, View itemView) {
//                        dialog.dismiss();
//                        int tag = (int) itemView.getTag();
//                        switch (tag) {
//                            case TAG_SHARE_WECHAT_FRIEND:
//                                Toast.makeText(getActivity(), "分享到微信", Toast.LENGTH_SHORT).show();
//                                break;
//                            case TAG_SHARE_WECHAT_MOMENT:
//                                Toast.makeText(getActivity(), "分享到朋友圈", Toast.LENGTH_SHORT).show();
//                                break;
//                            case TAG_SHARE_WEIBO:
//                                Toast.makeText(getActivity(), "分享到微博", Toast.LENGTH_SHORT).show();
//                                break;
//                            case TAG_SHARE_CHAT:
//                                Toast.makeText(getActivity(), "分享到私信", Toast.LENGTH_SHORT).show();
//                                break;
//                            case TAG_SHARE_LOCAL:
//                                Toast.makeText(getActivity(), "保存到本地", Toast.LENGTH_SHORT).show();
//                                break;
//                        }
//                    }
//                }).build().show();


        return builder;
    }

}
